// vue.config.js
const path = require('path');
const { name } = require('./package');


console.log(process, 'process');

function resolve(dir) {
  return path.join(__dirname, dir);
}
module.exports = {
    // options...
    // publicPath: '/mythree/',
    outputDir:"mythree",
    // assetsDir:"mythree/static/",
    pages: {
        index: {
            // entry for the page
            entry: 'src/main.js',
            // the source template
            template: 'public/index.html',
            // output as dist/index.html
            filename: 'index.html',
            // when using title option,
            // template title tag needs to be <title><%= htmlWebpackPlugin.options.title %></title>
            title: 'Index Page',
            // chunks to include on this page, by default includes
            // extracted common chunks and vendor chunks.
            chunks: ['chunk-vendors', 'chunk-common', 'index']
        }
    },
    devServer: {
      // host: '0.0.0.0',
      hot: true,
      port: 9999,
      disableHostCheck: true,
      overlay: {
        warnings: false,
        errors: true,
      },
      headers: {
        'Access-Control-Allow-Origin': '*',
      },
    },
    // 自定义webpack配置
    configureWebpack: {
      resolve: {
        alias: {
          '@': resolve('src'),
        },
      },
      output: {
        // 把子应用打包成 umd 库格式
        library: `${name}-[name]`,
        libraryTarget: 'umd',
        jsonpFunction: `webpackJsonp_${name}`,
      },
    },
}
